import React, { Component } from 'react'
import store from "../store"
import {connect} from "react-redux";
import {addnum} from "../action/numaction"
class Home extends Component<any,any> {
  render() {
    return (
      <div>
        <div>home全局参数Number：{store.getState().dataReducer.num}</div>
        <div><button onClick={()=>{store.dispatch(addnum(8))}}>+</button></div>
      </div>
    )
  }
}
let  mapStateToProps = (state:any)=>({
    num:state.dataReducer.num
  })
  let mapDispatchToProps={
    addnum
  }
  
export default connect(mapStateToProps,mapDispatchToProps)(Home)